package com.dzm.xgb.sms.properties;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 作者：Dzm
 * 时间：2024-08-20-14:45
 * 功能：
 */

@Configuration
@ConfigurationProperties(prefix = "aliyun.sms")
@Data
public class SmsProperties implements InitializingBean {
    private String endpoint;
    private String accessKey;
    private String accessSecret;
    private String signName;
    private String templateCode;

    public static String ENDPOINT;
    public static String ACCESS_KEY;
    public static String ACCESS_SECRET;
    public static String TEMPLATE_CODE;
    public static String SIGN_NAME;

    @Override
    public void afterPropertiesSet() throws Exception {
        ENDPOINT = this.endpoint;
        ACCESS_KEY = this.accessKey;
        ACCESS_SECRET = this.accessSecret;
        SIGN_NAME = this.signName;
        TEMPLATE_CODE = this.templateCode;
    }
}


